FROM python:3.6

RUN mkdir -p /opt/services/djangoapp/src

WORKDIR /opt/services/djangoapp/src

COPY . /opt/services/djangoapp/src

RUN ls -alh &&  pip install -i https://pypi.douban.com/simple  -r /opt/services/djangoapp/src/Box/requirements.txt && pip install -i https://pypi.douban.com/simple gunicorn

ENV TZ=Asia/Shanghai
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo '$TZ' > /etc/timezone
ENV LANG C.UTF-8

EXPOSE 9898 9999

CMD ["gunicorn", "--chdir", "Box", "--bind", ":9898", "Box.wsgi:application"]
